import { GTextFormat } from "../../../../../common/GTextFormat";
import { FontUtil } from "../../../../../common/font/FontUtil";
import { ObjCreate } from "../../../common/ObjCreate";
import { Language } from "../../../../../../extend/language/Language";
import { GRCThreeRankKillRenderer } from "./GRCThreeRankKillRenderer";
import { PageSelecter } from "../../../common/pageSelect/PageSelecter";
import { GameProxy } from "../../../../mvc/GameProxy";
import { DataProvider } from "../../../../../../fl/data/DataProvider";
import { GTileList } from "../../../../../../com/mui/controls/GTileList";
import { GButton } from "../../../../../../com/mui/controls/GButton";
type int = number;
//class GuildRobCityCopyThreeRankKill
    
    export  class GuildRobCityCopyThreeRankKill /* flash.display.Sprite */
    {
        constructor()
        {
            
            var loc1=new GTextFormat(FontUtil.songtiName, 12, 16776960, true, null, null, null, null);
            ObjCreate.createGTextField(Language.getString(60975), 20, 5, 100, 20, this, loc1);
            ObjCreate.createGTextField(Language.getString(60976), 100, 5, 100, 20, this, loc1);
            ObjCreate.createGTextField(Language.getString(60977), 280, 5, 100, 20, this, loc1);
            ObjCreate.createGTextField(Language.getString(60980), 400, 5, 100, 20, this, loc1);
            ObjCreate.createGTextField(Language.getString(60981), 470, 5, 100, 20, this, loc1);
            ObjCreate.createGTextField(Language.getString(60982), 560, 5, 100, 20, this, loc1);
            this._rankList = ObjCreate.createTileList(0, 35, 640, 372, this);
            this._rankList.columnWidth = 635;
            this._rankList.rowHeight = 36;
            this._rankList.setStyle("cellRenderer", GRCThreeRankKillRenderer);
            this._myRankBtn = ObjCreate.createGButton(Language.getString(60985), 175, 400, 75, 26, this);
            this._myRankBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onMyRankBtnClick);
            this._pageSelec = ObjCreate.createPageSelecter(260, 403, this, PageSelecter.CompleteMode);
            this._pageSelec.addEventListener(flash.events.Event.CHANGE, this.onPageChangeHandler);
            return;
        }

        public getRankData(arg1: Boolean=false): void
        {
            var loc1=flash.utils.getTimer();
            if (loc1 - this.time > 1000) 
            {
                this.time = loc1;
                GameProxy.robCityProxy.getRobCityThreeRank(2, 10, this._pageSelec.currentPage, arg1);
            }
            return;
        }

        /* internal  */onMyRankBtnClick(arg1): void
        {
            this.getRankData(true);
            return;
        }

        /* internal  */onPageChangeHandler(arg1): void
        {
            this.getRankData();
            return;
        }

        public updateRankData(arg1: DataProvider, arg2: int, arg3: int): void
        {
            this._rankList.dataProvider = arg1;
            this._pageSelec.maxPage = arg3;
            this._pageSelec.currentPage = arg2;
            return;
        }

        public dispose(): void
        {
            this._rankList.dataProvider = new DataProvider();
            return;
        }

        /* internal */ /* var */_rankList: GTileList;

        /* internal */ /* var */_pageSelec: PageSelecter;

        /* internal */ /* var */_myRankBtn: GButton;

        /* internal */ /* var */time: int;
    }
